// 用了immutable后,数据结构及其取和改都改变
// 注意: combineReducers 的引入也改变
import { Map } from 'immutable'//数据持久化,优化深拷贝性能
import { BREADJUDGE, BREADLIST } from '../actionType'
const initialState = Map({
  breadList: ['sss', 'ss'],
  isBread: true
})

export default (state = initialState, { type, payload }) => {
  switch (type) {

    case BREADJUDGE:
      return state.set('isBread', payload)
    case BREADLIST:
      return state.set('breadList', payload)
    default:
      return state
  }
}
